<template>
  <div class="testpaper">
    <div class="testBox">
      <div class="sign">
        <div class="sign-item" v-for="(item, index) in Test.sign" :key="index">
          {{ item }}
        </div>
      </div>
      <div class="title">{{ Test.title }}</div>
      <div class="info">
        <div class="info-item">
          考试时间<span> :{{ Test.time }}分钟</span>
        </div>
        <div class="info-item">
          试卷数量<span> :{{ Test.number }}张</span>
        </div>
        <div class="info-item">
          试题数量<span> :{{ Test.count }}题</span>
        </div>
      </div>
      <el-button
        type="primary"
        class="test-btn"
        :disabled="!Test.isUse"
        @click="handleClick"
        >开始答题</el-button
      >
    </div>
  </div>
</template>

<script>
import { ElMessage } from "element-plus";
export default {
  props: {
    Test: {
      type: Object,
      required: true,
    },
  },
  setup() {
    const handleClick = () => {
      ElMessage({
        message: "别点了,没做这功能。",
        type: "warning",
        center: true,
      });
    };

    return {
      handleClick,
    };
  },
};
</script>

<style lang="less" scoped>
.testBox {
  width: 220px;
  height: 250px;
  display: flex;
  justify-content: space-around;
  align-items: center;
  flex-direction: column;
  box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.3), -2px -2px 8px rgba(0, 0, 0, 0.3);
  margin: 10px 0;
  margin-left: 20px;
  .sign {
    width: 100%;
    .sign-item {
      float: left;
      width: 18px;
      height: 18px;
      padding: 5px;
      margin: 0 5px;
      font-size: 5px;
      line-height: 18px;
      text-align: center;
      border-radius: 5px;
      color: rgb(83, 132, 246);
      background-color: rgb(209, 233, 253);
    }
  }
  .title {
    font-weight: 700;
    font-size: 18px;
    text-align: center;
  }
  .info-item {
    font-size: 15px;
    color: rgb(179, 153, 166);
    span {
      font-size: 17px;
      font-weight: 700;
      color: black;
    }
  }

  .test-btn {
    width: 80%;
    height: 40px;
    margin-bottom: 10px;
  }
}
</style>
